extends layout

block content
    #reg
        form(action="/api/reg" method="POST" onsubmit="return regVild()")
            .regRow
                .left 用户名：
                input#username(type="text" name="username")
            .regRow
                .left 密码：
                input#password1(type="password" name="password")
            .regRow
                .left 确认密码：
                input#password2(type="password" name="password2")
            .regRow
                input#submit(type="submit" value="注册")
    script.
        function regVild(){
            var $username = $('#username');
            if( $username.val() === ''){
                alert('前端的验证，请正确输入');
                return false;
            }
            return true;
        }